import ajax from '@/utils/ajax'
import dialog from '@/utils/dialog'
import util from '@/utils/index'

export default function (query) {
  return ajax({
    url: `/f/msg/send?${util.objectToString(query)}`,
    data: query
  }).then(({code, data, msg}) => {
    if (code === 1) {
      return data
    } else {
      throw msg
    }
  }).catch(msg => dialog.showToast(msg || '请求失败'))
}
